import django
from django.utils import timezone
from django.conf import settings

if not settings.configured:
    settings.configure(
        # 替换为你的 Django 项目的实际设置模块
        DJANGO_SETTINGS_MODULE='project.settings'
    )
    django.setup()

def test():
    sales_date_monthly = timezone.now().date().replace(month=1, day=1)
    for i in range(12):
        current_date = sales_date_monthly.replace(month=(sales_date_monthly.month + i - 1) % 12 + 1,
                                                  year=sales_date_monthly.year + (
                                                              (sales_date_monthly.month + i - 1) // 12))
        print(current_date)


if __name__ == '__main__':
    test()
